% sentence(Parse,[mua, tu3, la5nh, sharp, SJ16VSL, o73, d9a6u],[]).
% mua tu3 la5nh/ ma1y la5nh/ tu3 d9o6ng sharp/samsung/lg xxx/yyy o73 d9a6u

sentence(s(NP, VP))-->np(NP),vp(VP).

% cum danh tu
np(np(N_tuhoi))-->n_tuhoi(N_tuhoi).

% cac tu hoi
n_tuhoi(n_tuhoi(mua))-->[mua].

% cum dong tu
vp(vp(SP, R))-->sp(SP), r(R).

% san pham
sp(sp(N_sp, N))-->n_sp(N_sp), n(N).

% cac loai san pham
n_sp(n_sp('tu3 la5nh'))-->[tu3, la5nh].
n_sp(n_sp('tu3 d9o6ng'))-->[tu3, d9o6ng].
n_sp(n_sp('tu3 ma1t'))-->[tu3, ma1t].
n_sp(n_sp('ma1y la5nh'))-->[ma1y, la5nh].
n_sp(n_sp('ma1y gia85t'))-->[ma1y, gia85t].
n_sp(n_sp('d9ie62u ho2a'))-->[d9ie62u, ho2a].

n(n(N_hsx, Pron_sp))-->n_hsx(N_hsx),!,pron_sp(Pron_sp).
n(Pron_sp)-->pron_sp(Pron_sp).

% cac hang san xuat
n_hsx(n_hsx(panasonic))-->[panasonic].
n_hsx(n_hsx(daikin))-->[daikin].
n_hsx(n_hsx(lg))-->[lg].
n_hsx(n_hsx(samsung))-->[samsung].
n_hsx(n_hsx(mitsubishi))-->[mitsubishi].
n_hsx(n_hsx(electrolux))-->[electrolux].
n_hsx(n_hsx(sharp))-->[sharp].
n_hsx(n_hsx(sanyo))-->[sanyo].
n_hsx(n_hsx(hitachi))-->[hitachi].
n_hsx(n_hsx(gree))-->[gree].

pron_sp(pron_sp(H))-->[H].

% Phu tu
r(r(W_odau))-->w_odau(W_odau).

w_odau('o73 d9a6u')-->[o73, d9a6u].